#write kernel image and filesystem to nand flash

send	"setenv ethaddr 00:11:f7:06:14:46"
expect {
    "DM355 IPNC # "
}
send "setenv ipaddr 192.168.1.33"
expect {
    "DM355 IPNC # "
}
send "setenv serverip 192.168.1.30"
expect {
    "DM355 IPNC # "
}
send "nand erase 0x200000 0x200000"
expect {
    "DM355 IPNC # "
}
send "nand read 0x82000000 0x200000 0x200000"
expect {
    "DM355 IPNC # "
}
send "tftpboot 0x82000000 uImage"
expect {
    "DM355 IPNC # "
}
send "nand write 0x82000000 0x200000 0x200000"

expect {
    "DM355 IPNC # "
}
#write file system to nand flash

send "nand read 0x82000000 0x200000 0x200000"
expect {
    "DM355 IPNC # "
}
send setenv bootargs 'mem=80M console=ttyS1,115200n8 root=/dev/ram0 rw initrd=0x82000000,10M ip=192.168.1.101:192.168.1.100:192.168.1.1:255.255.255.0:IST:eth0:off eth=00:0C:0C:A0:00:24 v4l2_video_capture=:device=MT9P031'
expect {
    "DM355 IPNC # "
}

send "nand erase 0x500000 0xa00000"
expect {
    "DM355 IPNC # "
}
send "nand read 0x82000000 0x500000 0xa00000"
expect {
    "DM355 IPNC # "
}
send "tftpboot 0x82000000 ramdisk_ist_3.0.x.gz"
expect {
    "DM355 IPNC # "
}
send "nand write 0x82000000 0x500000 0xa00000"
expect {
    "DM355 IPNC # "
}
send setenv bootcmd 'nand read 0x82000000 0x500000 0xa00000;nboot 0x80700000 0 0x200000;bootm 0x80700000'
expect {
    "DM355 IPNC # "
}
send "saveenv"
expect {
    "DM355 IPNC # "
}
send "boot"
expect {
}
#timeout 90
exit 0
